package com.zr.daoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.zr.dao.LZSQDaoWW;
import com.zr.util.JDBCUtil;

public class LZSQDaoImplWW implements LZSQDaoWW {

	@Override
	public boolean resignApplication(String date, String reason,String ltime, int eid) {
		boolean flag = false;
		StringBuffer sql = new StringBuffer("");
		sql.append(" INSERT INTO resign (resign.date, resign.reason,resign.ltime, resign.eid,resign.state)  ");
		sql.append(" VALUES ( ?,?,?,? ,?) ");
		Connection con = JDBCUtil.getConnection();
		try {
			PreparedStatement pst = con.prepareStatement(sql.toString());
		 pst.setString(1, date);  
		 pst.setString(2, reason);
		 pst.setString(3,ltime);
		 pst.setInt(4, eid);
		 pst.setString(5,"待审核");
			int i =   pst.executeUpdate();
			if(i>0){
				flag =true;
			}
			 pst.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return flag;
	}



		
	}
	